home *** CD-ROM | disk | FTP | other *** search
- function times()
- {
- if(tNum++ >= 40)
- {
- gameTime -= 1;
- tNum = 0;
- }
- if(gameTime <= 0)
- {
- manHp = 0;
- gameTime = 200;
- }
- }
- function superPower()
- {
- if(green <= 0)
- {
- powerTime.gotoAndStop("str");
- ability = "power";
- green = 20;
- man.prs._visible = true;
- powIco._alpha = 100;
- pTime = 0;
- tMax = 20;
- flyNow = false;
- spdNow = false;
- movspd = 5;
- }
- else if(blue <= 0)
- {
- powerTime.gotoAndStop("fly");
- ability = "fly";
- blue = 20;
- flyIco._alpha = 100;
- pTime = 0;
- tMax = 10;
- flyNow = false;
- spdNow = false;
- movspd = 5;
- }
- else if(red <= 0)
- {
- powerTime.gotoAndStop("eye");
- ability = "eye";
- red = 20;
- man.prs._visible = true;
- eyeIco._alpha = 100;
- pTime = 0;
- tMax = 10;
- flyNow = false;
- spdNow = false;
- movspd = 5;
- }
- else if(yellow <= 0)
- {
- powerTime.gotoAndStop("spd");
- ability = "speed";
- yellow = 20;
- speIco._alpha = 100;
- pTime = 0;
- tMax = 10;
- flyNow = false;
- spdNow = false;
- movspd = 5;
- }
- if(purple <= 0)
- {
- powerTime.gotoAndStop("bre");
- ability = "breath";
- purple = 20;
- man.prs._visible = true;
- breIco._alpha = 100;
- pTime = 0;
- tMax = 10;
- flyNow = false;
- spdNow = false;
- movspd = 5;
- }
- }
- function powTimeLeft()
- {
- if(tMax > 3)
- {
- dog_blink(8);
- }
- else
- {
- dog_blink(4);
- }
- pTime++;
- if(pTime >= 30)
- {
- pTime = 0;
- tMax -= 1;
- }
- if(tMax == 3 and land.flywar == true)
- {
- land.play();
- }
- if(tMax == 7 and land.flywar == true and land.boss.behit == false)
- {
- land.boss.gotoAndPlay("发射");
- land.boss.shakeNow = false;
- }
- if(tMax <= 0)
- {
- a = 0;
- pTime = 0;
- powIco._alpha = 50;
- eyeIco._alpha = 50;
- speIco._alpha = 50;
- breIco._alpha = 50;
- flyIco._alpha = 50;
- man.xiaoguo.gotoAndStop(1);
- powerTime.gotoAndStop(1);
- man.prs._visible = false;
- movlock = false;
- ability = null;
- man.breathed = false;
- movspd = 5;
- }
- }
- function inairNow()
- {
- if(inAir == true)
- {
- if(yinc < 15)
- {
- yinc += g;
- }
- if(yinc > 0)
- {
- if(man._y >= 600)
- {
- manHp = 0;
- }
- if(land._y > 0 && man._y >= 300 && nojump == false)
- {
- land._y -= yinc;
- enemy._y -= yinc;
- bg._y -= yinc;
- if(land._y <= 0)
- {
- land._y = 0;
- }
- if(enemy._y <= 0)
- {
- enemy._y = 0;
- }
- if(bg._y <= 0)
- {
- bg._y = 0;
- }
- }
- else
- {
- man._y += yinc;
- }
- }
- if(yinc < 0)
- {
- if(man._y < 300 && nojump == false)
- {
- land._y -= yinc;
- enemy._y -= yinc;
- bg._y -= yinc;
- }
- else
- {
- man._y += yinc;
- }
- }
- var _loc3_ = 0;
- while(_loc3_ < land_array.length)
- {
- landObject = this.land[land_array[_loc3_]];
- var _loc4_ = landObject.getBounds(_root).yMin;
- if(man.fk.hitTest(landObject) and landObject.noHit != true)
- {
- if(landObject.ice == true and man.fk.hitTest(landObject.fk) and yinc >= -2)
- {
- ice = true;
- }
- else
- {
- ice = false;
- }
- if(man._y - yinc < _loc4_)
- {
- inAir = false;
- canjump = true;
- man._y = _loc4_;
- if(spdNow == false and movlock == false)
- {
- man.gotoAndStop("τ½Ö");
- if(man.finish == true)
- {
- end = true;
- movlock = true;
- man.gotoAndPlay("finish");
- }
- }
- else if(spdNow == true and movlock == false)
- {
- man.gotoAndStop("加速");
- }
- yinc = 0;
- break;
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- else if(!this.man.fk.hitTest(landObject))
- {
- yinc = 1;
- inAir = true;
- }
- }
- function jump_Ob()
- {
- if(jLock == false)
- {
- if(Key.isDown(38) or Key.isDown(65))
- {
- if(canjump == true and movlock == false and inAir == false)
- {
- man.gotoAndStop("Φ╖│");
- js.start();
- inAir = true;
- if(spdNow == false)
- {
- yinc = -15;
- }
- else
- {
- yinc = -18;
- }
- canjump = false;
- }
- }
- }
- if(Key.isDown(38) or Key.isDown(65))
- {
- jLock = true;
- }
- else
- {
- jLock = false;
- }
- }
- function moveFunc()
- {
- if(ice == false)
- {
- icespdl = 0;
- icespdr = 0;
- if(man.lDown == false and man.rDown == false)
- {
- moveL = false;
- moveR = false;
- }
- if(man.lDown == true)
- {
- if(land._x < 0 and man._x <= 290)
- {
- land._x += movspd;
- bg._x += movspd / 2;
- moveR = true;
- moveL = false;
- }
- else if(man._x > 0)
- {
- man._x -= movspd;
- }
- }
- else if(man.rDown == true)
- {
- if(man._x >= 290 and land._x > 580 - land._width + 50 and scrlock == false)
- {
- land._x -= movspd;
- bg._x -= movspd / 2;
- moveL = true;
- moveR = false;
- }
- else if(man._x < 550)
- {
- man._x += movspd;
- }
- }
- }
- else
- {
- if(man.lDown == true and icespdl < 10)
- {
- icespdl += 1;
- }
- else if(man.rDown == true and icespdr < 10)
- {
- icespdr += 1;
- }
- if(icespdl > 0)
- {
- icespdl -= 0.2;
- }
- if(icespdr > 0)
- {
- icespdr -= 0.2;
- }
- if(icespdl > icespdr)
- {
- if(land._x < 0 and man._x <= 290)
- {
- land._x += icespdl;
- land._x -= icespdr;
- bg._x += icespdl / 2;
- bg._x -= icespdr / 2;
- }
- else if(man._x > 0)
- {
- man._x -= icespdl;
- man._x += icespdr;
- }
- }
- else if(man._x >= 290 and land._x > 580 - land._width + 50 and scrlock == false)
- {
- land._x += icespdl;
- land._x -= icespdr;
- bg._x += icespdl / 2;
- bg._x -= icespdr / 2;
- }
- else if(man._x < 550)
- {
- man._x += icespdr;
- man._x -= icespdl;
- }
- }
- var _loc3_ = 0;
- while(_loc3_ < land_array.length)
- {
- var _loc2_ = this.land[land_array[_loc3_]];
- if(man.fk.hitTest(_loc2_) and man.dDown == true)
- {
- man._y -= 5;
- }
- if(man.qfk.hitTest(_loc2_) and _loc2_.noWalk == true)
- {
- if(man.rDown == true)
- {
- land._x += movspd;
- bg._x += movspd / 2;
- moveR = true;
- }
- if(man.lDown == true)
- {
- land._x -= movspd;
- bg._x -= movspd / 2;
- moveL = true;
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function dog_blink(a_time)
- {
- if(a_i <= a_time)
- {
- a_i++;
- }
- if(a_i >= a_time and a_sta == true)
- {
- a = 150;
- a_i = 0;
- a_sta = false;
- }
- if(a_i >= a_time and a_sta == false)
- {
- a_sta = true;
- a = 0;
- a_i = 0;
- }
- }
- var pauses = false;
- var manHp = 3;
- var maxHp = 3;
- var coHp = 0;
- var life = 3;
- var movspd = 5;
- var gameTime = 200;
- var score = 0;
- var nowLevel = "level111";
- var green = 20;
- var blue = 20;
- var red = 20;
- var yellow = 20;
- var purple = 20;
- var scrlock = false;
- var end = false;
- bluNum.gotoAndStop(2);
- bluIco._alpha = 50;
- redNum.gotoAndStop(2);
- redIco._alpha = 50;
- yelNum.gotoAndStop(2);
- yelIco._alpha = 50;
- purNum.gotoAndStop(2);
- purIco._alpha = 50;
- var ability = null;
- var flyNow = false;
- var spdNow = false;
- var land_array = [];
- var enemy_array = [];
- var item_array = [];
- var dep = 1;
- var canjump = true;
- var movlock = false;
- var inAir = false;
- var yinc = 0;
- var nojump = true;
- var g = 1;
- var pLock = false;
- onEnterFrame = function()
- {
- if(dep >= 80)
- {
- dep = 0;
- }
- if(coHp == 2)
- {
- maxHp = 4;
- }
- else if(coHp == 4)
- {
- maxHp = 5;
- }
- if(end == false)
- {
- if(Key.isDown(80) and pLock == false)
- {
- if(_parent.menus._visible == false and pauses == false)
- {
- _parent.menus._visible = true;
- pauses = true;
- }
- else
- {
- _parent.menus._visible = false;
- pauses = false;
- }
- }
- }
- if(pauses == false and end == false)
- {
- if(flyNow == true)
- {
- ice = false;
- }
- times();
- if(flyNow == false or man.stopFly == true)
- {
- inairNow();
- }
- if(ability != null)
- {
- powTimeLeft();
- }
- if(movlock == false and end == false)
- {
- jump_Ob();
- superPower();
- moveFunc();
- }
- }
- if(Key.isDown(80))
- {
- pLock = true;
- }
- else
- {
- pLock = false;
- }
- };
- var icespdl = 0;
- var icespdr = 0;
- var ice = false;
- var tNum = 0;
- var pTime = 0;
- var tMax;
- var jLock = false;
- MovieClip.prototype.setBrightOffset = function(offset)
- {
- var This = new Color(this);
- var trans = This.getTransform();
- with(trans)
- {
- rb = gb = bb = offset;
- }
- This.setTransform(trans);
- };
- var a = 0;
- var a_i = 0;
- var a_sta = true;
-